package com.eco.fanliapp.controller.app;

import com.eco.fanliapp.common.base.BaseController;
import com.eco.fanliapp.common.response.ServerResponse;
import com.eco.fanliapp.entity.SySwitch;
import com.eco.fanliapp.service.ISySwitchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @date 2019-10-31
 */
@RestController
@RequestMapping("/app/swich")
public class SySwichAppController extends BaseController {
    @Autowired
    private ISySwitchService iSySwitchService;

    @GetMapping("/navigation/onOff")
    @ResponseBody
    public ServerResponse navigationOnOff() {
        HashMap map = new HashMap();
        SySwitch sySwitch = iSySwitchService.getById(11);
        if(sySwitch != null && sySwitch.getState() == 1){
            map.put("onOff",true);
        }else {
            map.put("onOff",false);
        }
        return ServerResponse.createBySuccess("查询成功",map);
    }
}
